package org.netty.udp.server.config;

import org.netty.udp.server.handler.UdpNettyServerHandler;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioDatagramChannel;

public class UdpServerChannelInit extends ChannelInitializer<NioDatagramChannel>{
	
	private EventLoopGroup group = new NioEventLoopGroup();

	@Override
	protected void initChannel(NioDatagramChannel ch) throws Exception {
		ChannelPipeline pipeline = ch.pipeline();
		pipeline.addLast(group, new UdpNettyServerHandler());
	}
}
